var panel = function(){
	var columnNum = 3;
	Ext.onReady(function(){
		Ext.Ajax.request({
			url:'url',
			method:'POST',
			scope:this,
			params:{},
			success:function(response,options){
				Ext.Msg.alert("提示信息",response.responseText);
				var respText = Ext.JSON.decode(response.responseText);
				columnNum = respText.length;
			},
			failure:function(response,options){
				Ext.Msg.alert("提示信息","请求数据失败！");
			}
		});
	});


	Ext.create('Ext.container.Viewport',{
			id:'home-panel',
			renderTo:Ext.getBody(),
			width:Ext.getBody().getWidth(),
			layout:{
				type:'table',
				columns:columnNum
			},
			defaults: {frame:true, width:200, height: 200},
			items:[{
		            title:'Item 1'
		        },{
		            title:'Item 2'
		        },{
		            title:'Item 3'
		        },{
		            title:'Item 4'
		        },{
		            title:'Item 5'
	        }]
	});
};


Ext.application({
	name:'home',
	launch:panel
});